package q1.project.core.entity;

import jakarta.persistence.Column;
import jakarta.persistence.MappedSuperclass;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import q1.project.core.jpa.annotation.Comment;

import java.time.LocalDateTime;

/**
 * @author sun
 * @date 2025/11/28 00:35
 */
@Getter
@Setter
@MappedSuperclass
@DynamicUpdate
public class BaseCreateEntity  extends BaseEntity {
    @Column(columnDefinition = "varchar(100) COMMENT '创建人Id'", updatable = false)
    @CreatedBy
    @Comment("创建人")
    private String createById;


    @CreatedDate
    @Column(updatable = false)
    @Comment("创建时间")
    private LocalDateTime createTime;
}
